<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="qr.js"></script>
    </head>
    <body>
        <canvas id="qr-canvas" width="300" height="300"></canvas>
        <br>
        <input id="input" onchange="refresh()" style="margin-left:50px"> <span id="bench"></span>
        <br>
        <script>
            QR.canvas = document.getElementById('qr-canvas')
            QR.draw('qr.js')

            QR.size = 300
            document.body.appendChild(QR.makeImage('test'))

            var input = document.getElementById('input'),
                bench = document.getElementById('bench')
            function refresh () {
                var s = Date.now()
                QR.draw(input.value)
                bench.textContent = (Date.now() - s) + 'ms'
            }
        </script>
    </body>
</html>